<template>
  <section class="modlude">
    <el-form :inline="true" :model="formSearch" class="form_inline" label-width="90px">
      <!-- <el-form-item label="所属组织" size="small">
          <el-cascader
              ref="cascader"
              v-model="option1"
              :options="dataTree"
              :props="defaultProps2"
              @change="handleChange"
              clearable
            >
            </el-cascader>
        </el-form-item> -->
      <el-form-item label="所属项目" size="small">
        <el-select v-model="formSearch.projectId" placeholder="请选择项目">
          <el-option v-for="(item,index) in xqTree" :label="item.name" :value="item.id" :key="index"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="巡查点名称" size="small">
        <el-input v-model="formSearch.name" placeholder="请输入巡查点名称"></el-input>
      </el-form-item>
      <el-form-item label="位置" size="small">
        <el-input v-model="formSearch.sectionName" placeholder="请输入位置"></el-input>
      </el-form-item>
      <el-form-item label="状态" size="small">
        <el-select v-model="formSearch.status" placeholder="请选择状态">
          <el-option label="全部" :value="''"></el-option>
          <el-option label="有效" :value="1"></el-option>
          <el-option label="无效" :value="0"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item size="small">
        <!--  v-if="$root.btnControl.find(item=>item=='view')" -->
        <el-button  @click="getlist">查 询</el-button>
      </el-form-item>
      <!-- <el-form-item>
        <el-button size="small" @click="">重 置</el-button>
      </el-form-item> -->
      <el-form-item size="small">
        <!-- v-if="$root.btnControl.find(item=>item=='add')"  -->
        <el-button size="small" @click="xinzheng"><i
            class="el-icon-plus"></i> 新 增</el-button>
      </el-form-item>
      
      <!-- <el-form-item>
        <el-button size="small" @click=""> 批量打印二维码</el-button>
      </el-form-item> -->
      <!-- v-if="$root.btnControl.find(item=>item=='delete')" -->
      <el-form-item size="small">
        <!-- v-if="$root.btnControl.find(item=>item=='delete')" -->
        <el-button size="small"  type="danger"
          @click="deleInfor(false)">批量删除</el-button>
      </el-form-item>
    </el-form>
    <el-table :data="formData" style="width: 100%" stripe @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55"></el-table-column>
      <el-table-column prop="projectName" label="所属项目"></el-table-column>
      <el-table-column prop="name" label="巡查点名称"></el-table-column>
      <el-table-column prop="houseName" label="巡查点位置">
        <template slot-scope="scope">
          {{scope.row.sectionName}}{{scope.row.houseName==null?'':'-'+scope.row.houseName}}
        </template>
      </el-table-column>
      <el-table-column label="状态">
        <template slot-scope="scope">
          {{scope.row.status==1?"有效":'无效'}}
        </template>
      </el-table-column>
      <el-table-column label="是否强制拍照">
        <template slot-scope="scope">
          {{scope.row.isPhoto==1?"是":'否'}}
        </template>
      </el-table-column>
      <el-table-column prop="littlePhoto" label="最少拍照数"></el-table-column>
      <el-table-column label="操作" fixed="right" width=400>
        <template slot-scope="scope">
          <!-- v-if="$root.btnControl.find(item=>item=='valid')" -->
          <el-button  size="small" 
            @click="effective(scope.row)"> {{scope.row.status==1?"无 效":'有 效'}}
          </el-button>
          <!-- v-if="$root.btnControl.find(item=>item=='edit')" -->
          <el-button type="warning" size="small" 
            @click="backfill(scope.row,2)">修 改</el-button>
            <!-- v-if="$root.btnControl.find(item=>item=='delete')" -->
          <el-button type="danger" size="small" 
            @click="deleInfor(scope.row.id)">删 除</el-button>
            <!-- v-if="$root.btnControl.find(item=>item=='view')" -->
          <el-button type="" size="small" 
            @click="backfill(scope.row,3)">详 情</el-button>
          <el-button type="" size="small" @click="sbcode(scope.row.id,scope.row)">二维码</el-button>
        </template>
      </el-table-column>
    </el-table>
    <paging @changePage=handleCurrentPage :get-total='total'></paging>
    <el-dialog :title="isAddorUpdate==1?'新增':isAddorUpdate==2?'修改':'详情'" :visible.sync="addDialog" @close="canceladd"
      :close-on-click-modal="false">
      <div class="cont_box_right">
        <el-form label-position="right" label-width="100px" :model="formPush" ref='xcdlist'>

          <el-form-item label="选择项目" size="small" prop="projectId" :rules="{
                required: true, message: '项目不能为空', trigger: 'blur'
            }">
            <el-select @change="xqselectchange" v-model="formPush.projectId" placeholder="请选择项目">
              <el-option v-for="(item,index) in xqTree" :label="item.name" :value="item.id" :key="index"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="选择位置" size="small" :rules="{
            required: true, message: '位置不能为空', trigger: 'blur'
        }">
            <el-input disabled v-model="formPush.namehouse" placeholder="请点击按钮选择位置"></el-input>
            <el-button size="small" @click="getsectionList"><i class="el-icon-plus"></i> 选择位置</el-button>
          </el-form-item>

          <el-form-item label="巡查点名称" size="small" prop="name" :rules="{
                required: true, message: '巡查点名称不能为空', trigger: 'blur'
            }">
            <el-input v-model="formPush.name" placeholder="请输入巡查点名称"></el-input>
          </el-form-item>

          <el-form-item label="巡查检查项" :rules="{
            required: true, message: '该项不能为空', trigger: 'change'
        }">
            <el-select v-model="formPush.examineId" size="small" multiple placeholder="请选择">
              <el-option v-for="item in xunchaxiangData" :key="item.id" :label="item.name" :value="item.id">
              </el-option>
            </el-select>
          </el-form-item>


          <el-form-item label="状态" prop="status" :rules="{
            required: true, message: '请选择！', trigger: 'blur'
        }">
            <el-radio v-model="formPush.status" :label="0">无效</el-radio>
            <el-radio v-model="formPush.status" :label="1">有效</el-radio>
          </el-form-item>
          <el-form-item label="强制拍照" prop="isPhoto" :rules="{
            required: true, message: '请选择！', trigger: 'blur'
        }">
            <el-radio v-model="formPush.isPhoto" :label="0">否</el-radio>
            <el-radio v-model="formPush.isPhoto" :label="1">是</el-radio>
          </el-form-item>
          <el-form-item label="最小拍照数" size="small" prop="littlePhoto" :rules="{
            required: true, message: '请选择！', trigger: 'blur'
        }">
            <el-select v-model="formPush.littlePhoto" placeholder="请选择最小拍照数">
              <el-option label="1" :value="1"></el-option>
              <el-option label="2" :value="2"></el-option>
              <el-option label="3" :value="3"></el-option>
              <el-option label="4" :value="4"></el-option>
              <el-option label="5" :value="5"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="图片标准：" prop="headImg">
            <el-upload ref="addUpdata" class="avatar-uploader" action="/api/v1.0/file/upload/file"
              :show-file-list="false" :headers='headers' :on-change="onChange" :on-success="handleAvatarSuccess">
              <img v-if="imageUrl" :src="imageUrl" class="avatar">
              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
            </el-upload>
          </el-form-item>
          <el-form-item label="请输入描述" size="small" prop="desc">
            <el-input v-model="formPush.desc"></el-input>
          </el-form-item>

          <div class="zhuyi">
            <!-- <p>注意：选择位置时可以只选择区域，也可以选择区域-房号。</p> -->
          </div>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button size="medium " @click="addDialog = false">取 消</el-button>
        <el-button size="medium " v-if="isAddorUpdate!=3" @click="addList('xcdlist')">提 交</el-button>
      </div>
    </el-dialog>


    <!-- 选择位置（区域、房间） -->
    <el-dialog width="30%" title="选择位置" :visible.sync="selecthouse" @close="closeqyfj"
      :close-on-click-modal="false">
      <el-form :inline="true" :model="formsectionData" class="form_inline">
        <el-form-item label="区域名称" size="small">
          <el-input v-model="formsectionData.name" placeholder="请输入区域名称"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button size="small" @click="getsectionList">查 询</el-button>
        </el-form-item>
      </el-form>
      <el-table @row-click="rowClick" :data="sectionData" style="top: -20px;width: 100%">
        <el-table-column width="25">
          <template slot-scope="scope">
            <el-radio
              @change='locationdform.location = scope.row.id,formPush.sectionId = scope.row.id,formPush.houseId ="",formPush.namehouse = scope.row.name'
              v-model="locationdform.location" :label="scope.row.id" style="color:transparent;"></el-radio>
          </template>
        </el-table-column>
        <el-table-column prop="name" label="区域名称"></el-table-column>
        <el-table-column prop="projectName" label="所属项目"></el-table-column>
      </el-table>
      <div class="pagination" style="margin-top: -15px;">
        <el-pagination layout="prev, pager, next" prev-text="上一页" next-text="下一页" @current-change="handleCurrentPage1"
          :page-size="5" :total="total1">
        </el-pagination>
      </div>
      <!-- <el-form :inline="true" :model="formhouseData" class="form_inline">
        <el-form-item label="房间名称" size="small">
          <el-input v-model="formhouseData.name" placeholder="请输入房间名称"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button size="small" @click="gethouselist">查 询</el-button>
        </el-form-item>
      </el-form>
      <el-table @row-click="rowhouseClick" :data="houseData" style="top: -20px;width: 100%">
        <el-table-column width="25">
          <template slot-scope="scope">
            <el-radio
              @change='locationdform.location = scope.row.id,formPush.houseId =scope.row.id,formPush.sectionId = scope.row.sectionId,formPush.namehouse = scope.row.name'
              v-model="locationdform.location" :label="scope.row.id" style="color:transparent;"></el-radio>
          </template>
        </el-table-column>
        <el-table-column prop="name" label="房间名称"></el-table-column>
        <el-table-column prop="sectionName" label="所属区域"></el-table-column>
      </el-table>
      <div class="pagination" style="margin-top: -15px;">
        <el-pagination layout="prev, pager, next" prev-text="上一页" next-text="下一页" @current-change="handleCurrentPage2"
          :page-size="5" :total="total2">
        </el-pagination>
      </div> -->
      <div slot="footer" class="dialog-footer">
        <el-button size="medium " @click="selecthouse = false">确 定</el-button>
      </div>
    </el-dialog>

    <!-- 二维码 -->
    <el-dialog title="巡查点二维码" :visible.sync="codeShow" width="25%" :close-on-click-modal="false">
      <div class="shouquan" id='printBill' ref="shouquan1">
        <div>巡查点名称：{{ewmwz.name}}</div>
        <div class="codediv">
          <div class="qrcode" ref="qrCodeUrl"></div>
        </div>
        <div>位置：{{ewmwz.sectionName}}{{ewmwz.houseName==null?'':'-'+ewmwz.houseName}}</div>
        <div>扫码获取巡查点详细信息</div>

      </div>
      <div slot="footer" class="dialog-footer">
        <el-button size="medium " @click="codeShow = false">关 闭</el-button>
        <el-button size="medium " @click="printContext">打印</el-button>
        <!-- updataImg(1) -->
      </div>
    </el-dialog>

  </section>
</template>

<script>
  import paging from "../paging"
  //   import paging1 from "../paging"
  import print from 'print-js'
  import QRCode from "qrcodejs2";
  import { updPatrolDot, deletePatrolDot, getPatrolDotList, getPatrolExamineList, addPatrolDot, sectionList, houseList, xqSelectList, orgTree } from '../../url/api';
  export default {
    data() {
      return {
        codeShow: false,
        // uploadURL: '/api/v1.0/file/upload/file',
        isAddorUpdate: 1,//1添加、2修改、3详情
        headers: {
          Authorization: sessionStorage.getItem('Authorization'),
          token: sessionStorage.getItem('token')
        },
        imageUrl: '',
        previewPath: '',
        previewVisible: false,
        hideUpload: false,
        headImg: '',//图片
        limitCount: 1,
        headers: {
          Authorization: sessionStorage.getItem('Authorization'),
          token: sessionStorage.getItem('token')
        },
        selecthouse: false,//房间选择窗口


        checkStrictly: false,
        bindRole: {},
        showmenuList: [],
        menuList: [],
        option1: [],
        xqTree: [],
        formSearch: {
          current: 1,
          size: 10,
          type: 1,
        },
        formSearch1: {
          type: 1,
        },
        locationdform: {},
        xunchaxiangData: [],
        formData: [],//数据
        sectionData: [],
        houseData: [],//房间数据
        // xcxData:[],//巡查项data
        formhouseData: {
          current: 1,
          size: 5
        },
        formsectionData: {
          current: 1,
          pid: 0,
          size: 5
        },
        formxunchaxiang: {
          current: 1,
          size: 5,
          type: 1,
        },
        //examineId:[],//巡查项id
        deleBatch: [],//删除数据
        formUpdate: {},//修改表单
        total1: 0,//数据总数
        total2: 0,//数据总数
        total: 0,//数据总数
        total3: 0,//数据总数
        pages: 0,//页面总数
        pages1: 0,//页面总数
        pages2: 0,//页面总数
        pages3: 0,//页面总数

        addDialog: false,
        updateDialog: false,
        dialog: false,
        fangjianname: {

        },
        formPush: {
          examineId: [],
          type: 1,
          status: 1,
          isPhoto: 1,
          littlePhoto: '',
          name: '',
          namehouse: '',
          desc:'',
        },
        dataTree: [],
        defaultProps: {//树状图key定义
          children: 'data',
          label: 'name'
        },
        defaultProps2: {
          children: 'children',
          label: 'name',
          value: 'id',
          expandTrigger: 'hover', checkStrictly: true
        },

        typeIds: [],
        imageUrl: '',
        terearIds: [],
        dynamicTags: [],
        xunchaxiang: false,
        ewmwz: {},
      }
    },
    methods: {
      xinzheng(){
        this.addDialog=true;
        this.formPush= {
          examineId: [],
          type: 1,
          status: 1,
          isPhoto: 1,
          littlePhoto: '',
          name: '',
          namehouse: '',
          desc:'',
        }
        this.imageUrl = ''
      },
      sbcode(id,row) {
        // console.log(id);
        let text = ''+ id;
        this.ewmwz = row;
        this.codeShow = true;
        setTimeout(() => {
          this.creatQrCode(text);
        }, 100)

      },
      creatQrCode(text) {
        // console.log(text);
        if (this.qrcode) {
          this.qrcode.clear(); // 清除代码
          this.qrcode.makeCode(text); // 生成另外一个二维码
          return
        }
        this.qrcode = new QRCode(this.$refs.qrCodeUrl, {
          text: text,
          width: 150,
          height: 150,
          colorDark: '#000000',
          colorLight: '#ffffff',
          correctLevel: QRCode.CorrectLevel.H
        })
      },
      //打印
      printContext() {
        const style = '@media print { .shouquan{ text-align: center;color: black;background: #fff;margin-left:20%} .codediv {margin: 20px 0;text-align: center; } ';

        printJS({
          printable: 'printBill', //shouquan打印区域
          type: 'html',  //打印类型html，还可以是json，image等，详细写法见官网
          //targetStyles: ['*'],  //css样式，写成*代表打印样式完全继承你页面的样式
          style: style
          //  maxWidth:'800px'  //打印界面最大宽度，适当调整可以解决打印页面过宽，显示不完整的问题
        })
      },



      effective(row) {
        let params = {
          id: row.id
        }
        if (row.status == 0) {
          params.status = 1
        } else if (row.status == 1) {
          params.status = 0
        }
        this.$confirm("确定要执行此操作吗？", '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          updPatrolDot(params).then((res) => {
            if (res.data.ok) {
              this.$message({
                message: '操作成功！',
                type: 'success'
              });
              this.getlist()
            } else {
              this.$message('操作失败！')
            }
          })
        })
      },

      backfill(row, index) {
        // debugger
        this.formPush= {
          examineId: [],
          type: 1,
          status: 1,
          isPhoto: 1,
          littlePhoto: '',
          name: '',
          namehouse: '',
          desc:'',
        }
        this.isAddorUpdate = index
        this.formPush.projectId = row.projectId
        if (row.houseName) {
          this.formPush.namehouse = row.houseName
          this.formPush.houseId = row.houseId
          this.formPush.sectionId = row.sectionId
        } else if (row.sectionName) {
          this.formPush.namehouse = row.sectionName
          this.formPush.sectionId = row.sectionId
        }
        this.formPush.name = row.name
        this.formPush.examineId = row.examineId
        this.formPush.status = row.status
        this.formPush.isPhoto = row.isPhoto
        this.formPush.littlePhoto = row.littlePhoto
        this.imageUrl = row.picture
        this.formPush.picture = row.picture
        this.formPush.desc = row.desc?row.desc:''
        this.formPush.id = row.id
        this.formxunchaxiang = {
          current: 1,
          size: 5,
          type: 1,
        },
          this.getxcxList(row.projectId);
        this.addDialog = true
      },


      // 图片上传
      onChange(file, fileList) {
        //console.log(file, fileList)
        this.imageUrl = URL.createObjectURL(file.raw);
      },
      handleAvatarSuccess(res, file) {//添加头像上传成功
        //console.log(res, file)
        this.imageUrl = URL.createObjectURL(file.raw);
        
        if (res.ok) {
          this.formPush.picture = res.data[0]
        }
      },
      deleInfor(ids) {

        let arrId = []
        if (ids) {
          arrId.push(ids)
        } else {
          if (this.deleBatch.length != 0) {
            this.deleBatch.filter((item) => {
              arrId.push(item.id)
              return item
            })
          } else {
            this.$message("请勾选要删除的数据！")
            return
          }
        }
        this.$confirm("确定要删除吗？", '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          deletePatrolDot(arrId).then((res) => {
            //console.log("删除", res)
            if (res.data.ok) {
              this.$message({
                message: '删除成功',
                type: 'success'
              });
              this.getlist()
            } else {
              this.$message('删除失败')
            }
          })

        })
      },


      addList(xcdlist) {
        console.log(this.formPush.sectionId,);
        if (this.formPush.namehouse) {
          console.log(this.formPush.houseId)
        } else {
          this.$message("请选择巡查点位置！")
          return;
        }
        if (this.formPush.examineId.length == 0) {
          this.$message("请选择巡查项！")
          return;
        }
        console.log("this.formPush", this.formPush)
        this.$refs.xcdlist.validate((valid) => {
          console.log("valid", valid)
          if (valid) {
            this.$confirm("确定要执行此操作吗？", '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              //this.addDialog = false
              //console.log(this.formPush)
              delete this.formPush.namehouse;
              if (this.isAddorUpdate == 1) {
                addPatrolDot(this.formPush).then((res) => {
                  //console.log("新增", res)
                  if (res.data.ok) {
                    this.$message({
                      message: '添加成功',
                      type: 'success'
                    });
                    this.getlist()
                  } else {
                    this.$message('添加失败')
                  }
                })
                this.addDialog = false
              } else if (this.isAddorUpdate == 2) {
                updPatrolDot(this.formPush).then((res) => {

                  if (res.data.ok) {
                    this.$message({
                      message: '修改成功！',
                      type: 'success'
                    });
                    this.getlist()
                  } else {
                    this.$message('修改失败！')
                  }
                })
                this.addDialog = false
              }


            })

          } else {
            console.log('error submit!!');
            return false;
          }
        });

      },
      xqselectchange(data) {

        this.formPush.namehouse = "";
        this.formPush.houseId = '';
        this.houseData = [];
        this.formPush.examineId = []
        console.log(data);
        this.getxcxList(data);
      },
      getsectionList() {
        if (this.formPush.projectId) {
          this.formsectionData.projectId = this.formPush.projectId;
          this.selecthouse = true;
        } else {
          this.$message("请先选择项目！")
          return
        }
        sectionList(this.formsectionData).then((res) => {//区域列表
          console.log(res)
          if (res.data.ok) {
            this.sectionData = res.data.data.records.filter((item) => {
              if (item.gmtModified) {
                item.gmtModified = this.$root.getDateArray(item.gmtModified)[9]
              }
              return item
            })
            this.total1 = res.data.data.total
            this.pages1 = res.data.pages
          } else {
            this.$message(res.data.msg);
          }
        })
      },
      getxcxList(projectId) {//巡查项选择
        let params = {
          projectId: projectId
        }
        getPatrolExamineList(params).then((res) => {//查询检查项列表
          console.log("检查项列表", res)
          if (res.data.ok) {
            this.xunchaxiangData = res.data.data.records.filter((item) => {
              return item
            })
            this.total3 = res.data.data.total
          } else {
            this.$message(res.data.msg);
          }
        })
        //     
      },
      //表格翻页多选
      getRowKeys: function (row) {
        return row.id;
      },
      toggleSelection4(val) {
        console.log("xuanzhonsg", val);
        this.dynamicTags = [];
        for (var i = 0; i < val.length; i++) {
          this.dynamicTags.push(val[i]);//直接push表格数据对象，这样就可以方便将两个数据进行关联，如方法：handeleClose

        }
      },
      rowClick(row, column) {
        if (row.name) {
          this.formhouseData.sectionName = row.name;
          this.formhouseData.projectId = this.formPush.projectId;
          // this.gethouselist();
        }
        console.log("row:", row)
        //this.selectfj = true;
      },
      rowhouseClick(row, column) {
        console.log("rowhouse:", row)
      },
      canceladd() {
        // this.addDialog = false;
        this.isAddorUpdate = 1,
          this.formPush = {
            examineId: [],
            status: 1,
            isPhoto: 1,
            type: 1,
            littlePhoto: ''
          };
        this.xunchaxiangData = []
      },
      closeqyfj() {
        this.formhouseData = {
          current: 1,
          size: 5
        }
      },
      gethouselist() {
        // console.log("zzzzzzzzzzzzzzzz");
        if (this.formhouseData.sectionName) {
          this.formhouseData.projectId = this.formPush.projectId;

          houseList(this.formhouseData).then((res) => {//更具区域名称查房间列表
            console.log(res)
            if (res.data.ok) {
              this.houseData = res.data.data.records.filter((item) => {
                if (item.gmtModified) {
                  item.gmtModified = this.$root.getDateArray(item.gmtModified)[9]
                }
                return item
              })
              this.total2 = res.data.data.total
              this.pages2 = res.data.pages
            } else {
              this.$message(res.data.msg);
            }
          })
        }
      },


      handleSelectionChange(val, self) {//多选
        this.deleBatch = val
        console.log(this.deleBatch)
      },

      getlist() {
        console.log("this.formSearch", this.formSearch);
        getPatrolDotList(this.formSearch).then((res) => {//查询巡查点列表
          console.log("巡查点列表:", res)
          if (res.data.ok) {
            this.formData = res.data.data.records.filter((item) => {
              return item
            })
            this.total = res.data.data.total
          } else {
            this.$message(res.data.msg);
          }
        })
      },
      getInit() {
        // this.getshiwuTypejieshu()
        this.getlist()
        // this.getworkOrderlist()
        xqSelectList({}).then((res) => {//项目选择列表
          console.log(res)
          if (res.data.ok) {
            this.xqTree = res.data.data
          }
        })
        // let org_tree={
        //   name:'',
        //   status:1
        // }
        // orgTree(org_tree).then((res)=>{//获取组织列表
        //   console.log(res)
        //   if(res.data.ok){
        //     this.dataTree = res.data.data
        //   }
        // })
      },
      // handleAvatarSuccess(res, file, fileList) {

      //   console.log(res)
      //   this.headImg = res.data[0];
      //   console.log("this.headImg ", this.headImg);

      // },
      // uploadChange(file, fileList) {
      //   this.headFile = file;
      //   this.headFileList = fileList;
      //   if (fileList.length == 1) {
      //     let { headImg, ...data } = this.xcdRules;
      //     this.xcdRules = data;
      //   }
      //   this.$refs.xcdlist.clearValidate('headImg');
      //   this.hideUpload = fileList.length >= this.limitCount;
      //   console.log("this.hideUpload", this.hideUpload);
      // },
      // // 处理图片预览效果
      // handlePreview(file) {
      //   this.previewPath = file.url;
      //   this.previewVisible = true
      // },
      // remove(file, fileList) {
      //   if (fileList.length == 0) {
      //     this.xcdRules.headImg = [{ required: true, message: '请上传图片', trigger: 'change' }];
      //   }
      //   this.hideUpload = fileList.length >= this.limitCount;

      // },
      handleCurrentPage(val) {//页码改变
        this.formSearch.current = val
        this.getlist()
      },
      handleCurrentPage1(val) {//页码区域改变
        this.formsectionData.current = val
        this.getsectionList()
      },
      handleCurrentPage2(val) {//页码区域改变
        this.formhouseData.current = val
        this.gethouselist()
      },
      handleCurrentPage3(val) {//页码区域改变
        this.formxunchaxiang.current = val
        this.getxcxList()
      },

      //----------tag 标签----
      handleClose(tag) {
        for (var i = 0; i < this.dynamicTags.length; i++) {
          if (tag.id === this.dynamicTags[i].id) {//以id作为key进行比对
            this.dynamicTags.splice(i, 1);//删除对应id的tag
            this.$refs.multipleTable2.toggleRowSelection(tag, false);//同时取消表格中对应行的勾选状态
          }
        }
        // this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
      },



    },
    mounted() {
      this.getInit()
    },
    components: {
      paging,
      //   paging1
    }
  }
</script>
<style>
  .hide .el-upload--picture-card {
    display: none;
  }

  .el-form-item {
    margin-bottom: 20px;
  }

  .codediv {
    margin: 20px 0;
    text-align: center;
  }

  .shouquan {
    text-align: center;
    color: black;
    background: #fff;
    padding: 50px 0;
  }

  .qrcode {
    display: inline-block;
  }
  
  .el-table--scrollable-y .el-table__body-wrapper {
    /* overflow-y: auto; */
  }

  .el-table__fixed-right-patch {
    position: absolute;
    /* top: -1px; */
    right: 0;
    /* background-color: #FFF; */
  }
</style>